home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Static vs Dynamic linking
- Date: Wed, 10 Apr 96 20:27:21 GMT
- Organization: none
- Message-ID: <829168041snz@genesis.demon.co.uk>
- References: <4kefrj$smn@nntp.ucs.ubc.ca> <316ADDB7.731@willows.com>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <316ADDB7.731@willows.com>
- tarang@willows.com "Tarang Deshpande" writes:
-
- >Daniel l Aldham wrote:
- >>
- >> Could someone explain , or point out a good reference to , what
- >> is the difference and/or advantages of static versus dynamic linking.
- >> Thanks
- >>
- >> Danny Aldham
- >
- >
- >Static linking occures at compile time whereas dynamic linking occurs
- >at run-time. Because of this a program that uses dynamic linking will
- >run slighly slower than the same program linked staticly because the
- >linker is figuring out what address to jump to when a call is made
- >as opposed to having figured that out when compiling as in static
- >linking.
-
- A dynamic linker links the executable at the point where it is run (or
- possibly the program may explicitly link other libraries while
- executing), it is not active during normal program execution.
-
- > The advantage of dynamic linking is it allows more than
- >one program at a time to share the DLL whereas if the programs were
- >staticly linked then each program would have its own copy.
-
- Static shared libraries have been doing this for years.
-
- > Another
- >advantage of dynamic linking is it allows you to change something
- >in the DLL without having to recompile the program(s) as long as
- >there is no interface change.
-
- Again static shared libraries do this.
-
- > As an offshoot to this if you need
- >to distribute your software then updating users with one DLL is easier
- >than updating users with multiple programs.
-
- You may be thinking of DLL in Windows specific terms. Of course static
- and dynamic linked libraries exist on a wide variety of platforms.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-